# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=enum4linux
pkgver=0.9.1
pkgrel=4
groups=('blackarch' 'blackarch-recon' 'blackarch-scanner')
pkgdesc='A tool for enumerating information from Windows and Samba systems.'
arch=('any')
url='http://labs.portcullis.co.uk/application/enum4linux/'
license=('GPL')
depends=('perl' 'polenum' 'smbclient' 'openldap')
#source=("http://labs.portcullis.co.uk/download/$pkgname-$pkgver.tar.gz")
source=("https://github.com/CiscoCXSecurity/enum4linux/archive/refs/tags/v$pkgver.tar.gz")
sha512sums=('acb454130e171eb5b9b5f9ff4bff823a4caefb8d052b092b0f84b2020314c1f1a4385342b6be091b2f84f2f0ea67b9fdfed23952bdb66014ad1acf6438b51d9d')
install="$pkgname.install"

prepare() {
  cd "$pkgname-$pkgver"

  sed -i 's|polenum.py|polenum|g' "$pkgname.pl"
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 "$pkgname.pl" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 share-list.txt "$pkgdir/usr/share/$pkgname/share-list.txt"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" CHANGELOG
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname" COPYING.ENUM4LINUX \
    COPYING.GPL
}

